﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Data.Common;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {

            Stack stack = new Stack();

            Console.WriteLine("开始往瓶子里放石头");

            stack.Push("1 号石头");
            stack.Push("2 号石头");
            stack.Push("3 号石头");
            stack.Push("4 号石头");
            stack.Push("5 号石头");


            foreach (var item in stack)
            {
                Console.WriteLine(item);
            }

            Console.WriteLine("取出石头：");

            while (stack.Count != 0)
            {

                Console.WriteLine(stack.Pop());
            }
        }
    }
}
